package badqn;

import java.util.Scanner;

public class Homework06 {

	public static void main(String[] args) {
		// 从键盘输入3个数（其中一个数用来代表加减乘除的符号，其余两个数用来计算），用来进行加减乘除 
		Scanner input = new Scanner(System.in);
		System.out.print("请输入一个数：");
		int a=input.nextInt();
		System.out.print("请输入一个数：");
		char p=input.next().charAt(0);
		System.out.print("请输入一个数：");
		int c=input.nextInt();
		switch(p) {
		case '+':
			System.out.println(String.format("%d + %d = %d", a, c, (a + c)));
			break;
		case '-':
			System.out.println(String.format("%d - %d = %d", a, c, (a - c)));
			break;
		case '*':
			System.out.println(String.format("%d * %d = %d", a, c, (a * c)));
			break;
		case '/':
			System.out.println(String.format("%d / %d = %d", a, c, (a / c)));
			break;
      
		}
		

	}

}
